<?php if (isset($add)) echo "<h2>Thêm hình ảnh mới</h2>"; else echo "<h2>Thay đổi thông tin hình ảnh</h2>";?>
<?php $action = "?act=createOrModifyPicture".(isset($picture_id) ? "&picture_id=".$picture_id : '').(isset($tour_id) ? "&tour_id=".$tour_id : '').(isset($room_id) ? "&room_id=".$room_id :'').(isset($hotel_id) ? "&hotel_id=".$hotel_id : '') ?>
<form name="edit_picture" action="<?php echo $action ?>" method="POST" enctype="multipart/form-data">
	<?php
        $picture = new Picture();
        if (isset($picture_id)) {
            $picture->select($picture_id);
        }
    ?>
    <div class='row_field'><img id="show_picture" src="<?php echo $picture->getPath()?>"></div>
    <div class='row_field'>
        <div class='label'>Đường dẫn</div>
        <?php if (isset($add)): ?>
            <div class='field'>
                <input class='inputbox' type="file" id="picture" name="picture" filename="<?php echo $picture->getname() ?>">
            </div>
        <?php endif ?>
    </div>
    <div class='row_field'>
        <div class='label'>
            <label for="picture_name">Tên Hình Ảnh:</label>
        </div>
        <div class='field'>
            <input class='inputbox' type="text" id="picture_name" name="picture_name" width="200" value="<?php echo $picture->getdisplay_name() ?>">
        </div>
    </div>
    <div class='row_field'>
        <input type='reset' value='Reset' class='button' />
        <input type="submit" value="Save" class='button' />
    </div>
</form>

	
